The Breakfast Club is an American syndicated radio show based in New York City. It is hosted by DJ Envy, Charlamagne tha God and rotating guest hosts and celebrities
Kurt Alexander (born September 8, 1969), better known as Big Boy, is a nationally syndicated American radio host and actor.
Candace Owens is a political commentator and host of The Candace Owens Show. She is the founder of the national #Blexit movement and tours the country delivering speeches to capacity crowds. Originally from Stamford, Connecticut, she now lives in Washington, DC.
Ben Shapiro is editor-in-chief of The Daily Wire and host of "The Ben Shapiro Show," the top conservative podcast in the nation.
A panel of female professionals from different walks of life discusses the latest and important issues affecting the lives of humans.
Three-time Super Bowl Champion Shannon Sharpe sits down with athletes, celebrities, and influencers.
# lets import libraries
from googleapiclient.discovery import build
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# Function to get Breakfast club Youtube channel statistics
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
Breakfast_club_channel_id = ['UChi08h4577eFsNXGd3sxYhw' # Breakfast club
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, Breakfast_club_channel_id ):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(Breakfast_club_channel_id )
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube,Breakfast_club_channel_id)
[{'Channel_name': 'Breakfast Club Power 105.1 FM', 'Subscribers': '5430000', 'Views': '3057672844', 'Total_videos': '10167'}]
channel_statistics = get_channel_stats(youtube,Breakfast_club_channel_id )
Breakfast_club_channel_data =pd.DataFrame(channel_statistics)
Breakfast_club_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | Breakfast Club Power 105.1 FM | 5430000 | 3057672844 | 10167 |
# Function to get Bigboy Youtube channel statistics
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
Bigboy_channel_id = ['UCvIFYR01Rp0VX5vegE_uHKQ' # Bigboy
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, Bigboy_channel_id ):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(Bigboy_channel_id )
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube,Bigboy_channel_id)
[{'Channel_name': 'BigBoyTV', 'Subscribers': '1320000', 'Views': '374265631', 'Total_videos': '1470'}]
channel_statistics = get_channel_stats(youtube,Bigboy_channel_id )
Bigboy_channel_data =pd.DataFrame(channel_statistics)
Bigboy_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | BigBoyTV | 1320000 | 374265631 | 1470 |
# Function to get Candice Owens Youtube channel statistics
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
Candice_Owens_channel_id = ['UCkY4fdKOFk3Kiq7g5LLKYLw' # Candice Owens
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, Candice_Owens_channel_id):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(Candice_Owens_channel_id)
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube,Candice_Owens_channel_id)
[{'Channel_name': 'Candace Owens Podcast', 'Subscribers': '2610000', 'Views': '607475778', 'Total_videos': '1737'}]
channel_statistics = get_channel_stats(youtube,Candice_Owens_channel_id)
Candice_Owens_channel_data =pd.DataFrame(channel_statistics)
Candice_Owens_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | Candace Owens Podcast | 2610000 | 607475778 | 1737 |
# Function to get Ben Shapiro Youtube channel statistics
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
Ben_Shapiro_channel_id = ['UCnQC_G5Xsjhp9fEJKuIcrSw' # Ben Shapiro
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, Ben_Shapiro_channel_id ):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(Ben_Shapiro_channel_id )
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube,Ben_Shapiro_channel_id)
[{'Channel_name': 'Ben Shapiro', 'Subscribers': '6680000', 'Views': '3024522666', 'Total_videos': '5406'}]
channel_statistics = get_channel_stats(youtube,Ben_Shapiro_channel_id)
Ben_Shapiro_channel_data =pd.DataFrame(channel_statistics)
Ben_Shapiro_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | Ben Shapiro | 6680000 | 3024522666 | 5406 |
# Function to get The View Youtube channel statistics
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
The_View_channel_id = ['UCeH6qE4V7n5tVwP7NkdrtJg' # The View
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube, The_View_channel_id):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(The_View_channel_id)
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube,The_View_channel_id)
[{'Channel_name': 'The View', 'Subscribers': '1190000', 'Views': '547834752', 'Total_videos': '4419'}]
channel_statistics = get_channel_stats(youtube,The_View_channel_id )
The_View_channel_data =pd.DataFrame(channel_statistics)
The_View_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | The View | 1190000 | 547834752 | 4419 |
# Function to get Club Shay Shay Youtube channel statistics
api_key = 'AIzaSyB24Kop04L1GlTgRCm1XtQ4KB2a4gaBOwA'
Club_Shay_Shay_channel_id = ['UCQoxJOkwaCgyzQtiuAIDcuw' # Club Shay Shay
]
youtube = build('youtube','v3',developerKey = api_key)
from googleapiclient.errors import HttpError
def get_channel_stats(youtube,Club_Shay_Shay_channel_id):
all_data = []
try:
request = youtube.channels().list(
part='snippet,contentDetails,statistics',
id=','.join(Club_Shay_Shay_channel_id)
)
response = request.execute()
for item in response.get('items', []):
snippet = item.get('snippet', {})
statistics = item.get('statistics', {})
data = {
'Channel_name': snippet.get('title', ''),
'Subscribers': statistics.get('subscriberCount', ''),
'Views': statistics.get('viewCount', ''),
'Total_videos': statistics.get('videoCount', '')
}
all_data.append(data)
except HttpError as e:
print(f"HTTP error occurred: {e}")
print(f"Request URL: {e.resp.request.url}")
print(f"Request body: {e.resp.request.body}")
return all_data
get_channel_stats(youtube,Club_Shay_Shay_channel_id)
[{'Channel_name': 'Club Shay Shay', 'Subscribers': '2530000', 'Views': '448620526', 'Total_videos': '1777'}]
channel_statistics = get_channel_stats(youtube,Club_Shay_Shay_channel_id)
Club_Shay_Shay_channel_data =pd.DataFrame(channel_statistics)
Club_Shay_Shay_channel_data
Channel_name | Subscribers | Views | Total_videos | |
---|---|---|---|---|
0 | Club Shay Shay | 2530000 | 448620526 | 1777 |
# Combine DataFrames using concat
combined_interview_channels_df = pd.concat([
Breakfast_club_channel_data ,
Bigboy_channel_data,
Candice_Owens_channel_data,
Ben_Shapiro_channel_data ,
The_View_channel_data,
Ben_Shapiro_channel_data ,
Club_Shay_Shay_channel_data,
], ignore_index=True)
# Display the result
print(combined_interview_channels_df)
Channel_name Subscribers Views Total_videos 0 Breakfast Club Power 105.1 FM 5430000 3057672844 10167 1 BigBoyTV 1320000 374265631 1470 2 Candace Owens Podcast 2610000 607475778 1737 3 Ben Shapiro 6680000 3024522666 5406 4 The View 1190000 547834752 4419 5 Ben Shapiro 6680000 3024522666 5406 6 Club Shay Shay 2530000 448620526 1777
# lets change the datatypes to perform visualisations
combined_interview_channels_df['Subscribers'] = pd.to_numeric(combined_interview_channels_df['Subscribers'])
combined_interview_channels_df['Views'] = pd.to_numeric(combined_interview_channels_df['Views'])
combined_interview_channels_df['Total_videos'] = pd.to_numeric(combined_interview_channels_df['Total_videos'])
# letsconirm if the datatypes has changed
combined_interview_channels_df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 7 entries, 0 to 6 Data columns (total 4 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Channel_name 7 non-null object 1 Subscribers 7 non-null int64 2 Views 7 non-null int64 3 Total_videos 7 non-null int64 dtypes: int64(3), object(1) memory usage: 356.0+ bytes
import matplotlib.pyplot as plt
# Sort the DataFrame by 'Subscribers' in descending order
combined_interview_channels_df_subscribers_sorted = combined_interview_channels_df.sort_values(by='Subscribers', ascending=False)
# Plotting Subscribers in descending order
fig, axes = plt.subplots(nrows=3, ncols=1, figsize=(10, 15))
axes[0].bar(combined_interview_channels_df_subscribers_sorted['Channel_name'], combined_interview_channels_df_subscribers_sorted['Subscribers'], color='blue')
axes[0].set_title('Subscribers')
# Shorten the x-axis labels for better visibility
axes[0].set_xticklabels([label[:10] + '...' for label in combined_interview_channels_df_subscribers_sorted['Channel_name']], rotation=45, ha='right')
# Sort the DataFrame by 'Views' in descending order
combined_interview_channels_df_views_sorted = combined_interview_channels_df.sort_values(by='Views', ascending=False)
# Plotting Views in descending order
axes[1].bar(combined_interview_channels_df_views_sorted['Channel_name'], combined_interview_channels_df_views_sorted['Views'], color='green')
axes[1].set_title('Views')
# Shorten the x-axis labels for better visibility
axes[1].set_xticklabels([label[:10] + '...' for label in combined_interview_channels_df_views_sorted['Channel_name']], rotation=45, ha='right')
# Sort the DataFrame by 'Total_videos' in descending order
combined_interview_channels_df_total_videos_sorted = combined_interview_channels_df.sort_values(by='Total_videos', ascending=False)
# Plotting Total Videos in descending order
axes[2].bar(combined_interview_channels_df_total_videos_sorted['Channel_name'], combined_interview_channels_df_total_videos_sorted['Total_videos'], color='orange')
axes[2].set_title('Total Videos')
# Shorten the x-axis labels for better visibility
axes[2].set_xticklabels([label[:10] + '...' for label in combined_interview_channels_df_total_videos_sorted['Channel_name']], rotation=45, ha='right')
# Adjust layout for better visibility
plt.tight_layout()
# Show the plot
plt.show()
C:\Users\jki\AppData\Local\Temp\ipykernel_14084\765753836.py:13: UserWarning: FixedFormatter should only be used together with FixedLocator axes[0].set_xticklabels([label[:10] + '...' for label in combined_interview_channels_df_subscribers_sorted['Channel_name']], rotation=45, ha='right') C:\Users\jki\AppData\Local\Temp\ipykernel_14084\765753836.py:23: UserWarning: FixedFormatter should only be used together with FixedLocator axes[1].set_xticklabels([label[:10] + '...' for label in combined_interview_channels_df_views_sorted['Channel_name']], rotation=45, ha='right') C:\Users\jki\AppData\Local\Temp\ipykernel_14084\765753836.py:33: UserWarning: FixedFormatter should only be used together with FixedLocator axes[2].set_xticklabels([label[:10] + '...' for label in combined_interview_channels_df_total_videos_sorted['Channel_name']], rotation=45, ha='right')